<!--
  @author nowind
  @since 17/07/23 14:34
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>配件拆分</title>

</head>
<body>
<style type="text/css">
    .layui-form-select dl {
        max-height: 130px;
    }

    .layui-anim-upbit dl {
        max-height: 130px;
    }
</style>
<div class="layui-fluid">

    <blockquote class=" layui-crumb">
        <span>配件管理</span>&nbsp;&nbsp;>
        <a lay-href="/part/list.action">配件管理</a>&nbsp;&nbsp;>&nbsp;
        <span>拆分管理</span>
    </blockquote>

    <form method="post" action="" class="layui-form" lay-filter="zmn-plat-relation-form">
        <div class="layui-card" style="padding-right: 20px; height: 160px">
            <input type="hidden" name="oneSkuId" id="oneSkuId" th:value="${oneSkuId}"/>
            <div class="layui-split">&nbsp;</div>
            <div class="layui-split">&nbsp;</div>
            <div class="layui-row layui-col-space8">
                <div class="zmn-form-item">

                    <!--<div class="item-inline">-->
                        <!--<label class="inline-label layui-form-required">区：</label>-->
                        <!--<div class="inline-box">-->
                            <!--<div class="inline-box-cc">-->
                                <!--<div class="box-input-inline">-->
                                    <!--<select name="countyIds" xm-select="countyId" id="countyId" lay-filter="countyId">-->
                                        <!--<option value="">-选择-</option>-->
                                    <!--</select>-->
                                <!--</div>-->
                            <!--</div>-->
                        <!--</div>-->
                    <!--</div>-->

                    <div class="layui-col-md3 layui-col-sm4">
                        <div class="layui-form-item layui-form-item-sm">
                            <label class="layui-form-label layui-form-label-extend layui-form-required">配件2</label>
                            <div class="layui-input-block layui-input-block-extend" >
                                <select name="manySkuId" id="manySkuId" lay-filter="manySkuId" lay-verify="required" lay-search>
                                    <option value=""></option>
                                    <option th:each="sku:${skus}"
                                            th:value="${sku.skuId}"
                                            th:text="${sku.fullName}">
                                    </option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="layui-col-md3 layui-col-sm4">
                        <div class="layui-form-item layui-form-item-sm">
                            <label class="layui-form-label layui-form-label-extend layui-form-required">1:N(数量)</label>
                            <div class="layui-input-block layui-input-block-extend" >
                                <input type="text" id="number" name="number" autocomplete="off" class="layui-input" lay-verify="required|number" maxlength="6"/>
                            </div>
                        </div>
                    </div>

                    <div class="layui-col-md3 layui-col-sm4" th:if="${#authPermit.checkPermit('/part/relation/addEdit.action')}">
                        <div class="layui-form-item layui-form-item-sm">
                            <button type="submit" class="layui-btn" lay-submit lay-filter="zmn-part-relation-submit">添加配件关联</button>
                        </div>
                    </div>
                </div>

            </div>
        </div>

        <div class="layui-card">

            <div class="layui-split">&nbsp;</div>
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>配置列表</legend>
            </fieldset>
            <div class="layui-split">&nbsp;</div>

            <div class="layui-card-body">
                <table class="layui-hide" id="zmn-part-table" lay-filter="zmn-part-table"></table>
            </div>
        </div>
    </form>


</div>
<script type="text/javascript" th:inline="javascript">
    var json = {
        items: [[${relations}]]
    };

    let permission = {
        hasEdit: [[${#authPermit.checkPermit('/part/relation/addEdit.action')}]],
        hasDel: [[${#authPermit.checkPermit('/part/relation/del.action')}]],
    };

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        plat_part_relation_edit: "{/}/static/js/module/part/relation/zmn.plat.relation.edit"
    }).use(['index', 'plat_part_relation_edit']);
</script>


<script type="text/html" id="zmn-part-table-bar">
    {{#  if(permission.hasDel){ }}
    <div>
        <a lay-event="del" class="layui-btn layui-btn-xs layui-btn-danger">删除</a>
    </div>
    {{#}}}
</script>
</body>
</html>